#ifndef __SF6_H
#define __SF6_H


#include "modbus.h"
#include "UsartDMA.h"


#define SF6_ID  0x1f       //传感器地址
#define SF6_ReadGas 0x04     //读气体浓度值功能码
#define SF6_SetAddr 0x06  	//设置传感器地址功能码
#define SF6_REG_Val	0x0000    //SF6浓度寄存器      	 
#define SF6_REG_SetAddr	      0x0010


struct _SF6
{
	 uint8_t SendBuff[8];
	 uint8_t RecBuff[7]; 
	 uint16_t CRC_Val;
	 uint8_t CRC_H,CRC_L;
	 uint8_t Recv_CRC_H,Recv_CRC_L;
	 volatile uint8_t  PPM_H,PPM_L;
};

extern struct _SF6 SF6;

 void SF6_SendData(uint8_t ID,uint8_t function,uint16_t Reg);
 FlagStatus SF6_ReadData(uint8_t ID);

#endif
